package homework.mapper;

import homework.entity.Goods;
import homework.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

@Mapper
@Repository
public interface UserMapper {

    List<User> queryAll();

    void register(@Param("user") User user); //注册新用户

    User login(@Param("zhangHao") String zhangHao,@Param("miMa") String miMa);  //登录

    void buy(@Param("balance") BigDecimal balance,@Param("zhangHao") String zhangHao); //根据账号扣取用户余额

    void addBalance(@Param("zhangHao") String zhangHao,@Param("balance") BigDecimal balance);     //用户对余额充值

    User queryByName(@Param("zhangHao") String zhangHao);       //查询该账号是否已被注册
}
